<template>
  <div class="upload-body">
    <el-dialog v-model="centerDialogVisible" title="全部评论" width="50%" center>
      <commentItem :type="2" :postsDetail="postsDetail" :commentIndex="commentIndex"></commentItem>

      <!-- <template #footer right>
        <span class="dialog-footer flex">
          <div class="close-btn f-j-a-c" @click="close">取消</div>
          <div class="confirm-btn f-j-a-c" @click="confirm">确定</div>
        </span>
      </template> -->
    </el-dialog>
  </div>
</template>
<script>
import commentItem from "../../../components/commentItem.vue";
import { toFixedNum } from "@/utils/common.js";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
import {
  defineComponent,
  reactive,
  toRefs,
  onUnmounted,
  onMounted,
  computed,
  getCurrentInstance,
} from "vue";
export default defineComponent({
  postsDetail: {
      type: Object,
      default: () => {},
      // default:{}
    }, //内容
  components: {
    commentItem,
  },
  setup(props, { attrs, slots, emit }) {
    const router = useRouter();
    const { proxy } = getCurrentInstance();
    const store = useStore();

    let data = reactive({
      centerDialogVisible: false,
    });

    // 打开弹框
    let open = () => {
      data.centerDialogVisible = true;
    };

    // 取消
    let close = () => {
      data.centerDialogVisible = false;
    };

    // 确定
    let confrim = () => {
      data.centerDialogVisible = false;
    };

    return {
      close,
      confrim,
      open,
      ...toRefs(data),
    };
  },
});
</script>
<style lang="scss" scoped>
.upload-body {
  :deep(.el-dialog.el-dialog--center) {
    border-radius: 20px;
    min-width: 600px;
    max-width: 800px;
  }

  :deep(.el-dialog--center .el-dialog__footer) {
    text-align: right !important;
  }
}

// 底部按钮
.dialog-footer {
  font-size: 14px;
  font-weight: bold;
  justify-content: flex-end;
  > div {
    height: 36px;
    width: 80px;
    border-radius: 10px;
    margin-left: 10px;
    cursor: pointer;
    background: #f3f4f5;
    color: #656f79;
    &:active {
      opacity: 0.7;
    }
  }
  .confirm-btn {
    background: linear-gradient(90deg, #9ed8e6 0%, #a1f0c0 100%);
    color: #ffffff;
  }
}
</style>
